using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace RBSViewer
{
    public partial class LoginForm : Form
    {
        public static StatusForm statusform;
        public LoginForm()
        {
            InitializeComponent(); 
            PWAURL.Text = Properties.Settings.Default.PWAURL;
        }

        //This actually logs on
        //Only support Windows auth at the moment
        //Forms auth support is an excercise for the reader ;)
        private void OK1_Click_1(object sender, EventArgs e)
        {
            this.Hide();
            if (!PWAURL.ToString().EndsWith("/"))
            {
                PWAURL.Text = PWAURL.Text + "/";
            }
            statusform = new StatusForm();
            statusform.statusstring = "Loading RBS details...";
            statusform.Show();

            MainForm myform = new MainForm();
            MainForm.PWAURL = PWAURL.Text;
            myform.RdbServer = ServerName.Text;
            myform.RdbDatabase = DatabaseName.Text;
            myform.BindForm();
            statusform.Hide();
            myform.Show();
        }

        private void Cancel1_Click_1(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}